<?php
/**
 * Created by PhpStorm.
 * User: Raytine
 * Date: 2019/11/28
 * Time: 22:11
 */

namespace App\Service;


use Illuminate\Support\Facades\Log;

class MessageService
{
        protected $sms;
        public function __construct()
        {
            $this->sms=app('sms');
        }

        public function  sendMessage($mobile,$name,$date,$num){
            try{
                $result= $this->sms->send($mobile, [
                    'template' => 'SMS_178990616',
                    'data' => [
                        'name' =>$name ,//名称
                        'date'=> $date,//date
                        'num'=> $num,
                    ],
                ]);
            }catch (\Exception $exception){
                Log::channel('aliyun')->info('阿里云短信报错',$exception->getMessage());
            }

        }
}